import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 牛客网.入门题.统计输入整数个数
 */

class Main {
    public static void main(String[] args) {
        int count = 0;
        Scanner scanner = new Scanner(System.in);

        //write your code here......
        while(true) {
            if(scanner.nextInt() <= 0) {
                break;
            }
            count++;
        }
        System.out.print(count);
    }
}

public class Test {
}
